Longest Substring Without Repeats

Medium

Question

Find the length of the longest substring without repeating characters in the given input string.

Input: "abaabc"

Output: 3

The longest substring without repeating characters is "abc".

Input: "helloworld"

Output: 5

The longest substring without repeating characters is "world".

Input: "aaaaaa"

Output: 1

The longest substring without repeating characters is "a".

Clarify the problem

What are some questions you'd ask an interviewer?

Understand the problem

What is the length of the longest substring without repeating characters in the string "rabdra"?
2
3
4
5

Take a moment to understand the problem and think of your approach before you start coding.